package com.atguigu.canal;

import com.atguigu.canal.client.CanalClient;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;

import javax.annotation.Resource;

//http://localhost:8001/swagger-ui.html
@SpringBootApplication
@ComponentScan(basePackages = {"com.atguigu"})
//加上注册进行注解
//@EnableDiscoveryClient//nacos进行注册
//@EnableFeignClients//服务调用注解

public class CanalApplication implements CommandLineRunner {

    @Resource
    private CanalClient canalClient;

    public static void main(String[] args) {
        SpringApplication.run(CanalApplication.class,args);
    }

    @Override
    public void run(String... args) throws Exception {
        //实现监听的操作
        canalClient.run();
    }
}

